BeliefUpdates:
	{true} UpdateProperties([Width,Height,NrAgents,TeamName,Placement]) {width(Width),height(Height),teamName(TeamName),placement(Placement),propertiesLoaded}
	{not activated(Agent,_,_,_,_)} AgentActivated(Agent,X,Y,BodyType,Rank) {activated(Agent,X,Y,BodyType,Rank)}
	{true} DistributedWorkers() {distributedWorkers}
Beliefs:
	workerAgent(worker1).
	workerAgent(worker2).
	workerAgent(worker3).
	workerAgent(worker4).
	workerAgent(worker5).
	workerAgent(worker6).
	workerAgent(worker7).
	workerAgent(worker8).
	workerAgent(worker9).
	workerAgent(worker10).
	workerAgent(worker11).
	workerAgent(worker12).
	workerAgent(worker13).
	workerAgent(worker14).
	workerAgent(worker15).
	nrAgents(15).
	
Goals:
	propertiesLoaded,
	distributedWorkers
	
PG-rules:

	propertiesLoaded <- true |
	{
		@competition( getProperties(), ActionResult);
		B( ActionResult = [actionresult( Properties )] );
		UpdateProperties(Properties)
	}
	
	distributedWorkers <- width(Width) and height(Height) and placement(Placement) and teamName(TeamName) and nrAgents(NrAgents)
						 and findall(A,workerAgent(A),Workers)|
	{
		@competition(placeAgents(Workers,Width,Height,NrAgents,TeamName,Placement),ActionResult);
		B( ActionResult = [actionresult( Placements )] );
		distributeWorkers(Placements,1);
		DistributedWorkers()
	}
	
	
PC-rules:	

	distributeWorkers([[X,Y,Agent,A,BodyType,C] | Rest],Rank) <- true |
	{
		send(Agent,inform,activate(X,Y,BodyType,Rank));
		AgentActivated(Agent,X,Y,BodyType,Rank);
		if B( Rest = []) then { skip } else { distributeWorkers(Rest,Rank+1) }
	}